﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entities;
using AutoMapper;
namespace Data
{
   public   class ChiTietHoaDonRepository
    {
       public static void Insert(ChiTietHoaDonDTO ct)
       {
           NhaSachEntities contecxt = new NhaSachEntities();
           ChiTietHoaDon cthd = new ChiTietHoaDon()
                               {
                                   MaChiTiet = ct.MaChiTiet,
                                   MaHoaDon = ct.MaHoaDon,
                                   MaSach = ct.MaSach,
                                   DonGiaBan=ct.DonGiaBan,
                                   SoLuongBan=ct.SoLuongBan
                               };
           contecxt.AddToChiTietHoaDonList(cthd);
           contecxt.SaveChanges();

       }
    }
}
